package com.juyu.miliao.api.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.core.RabbitTemplate.ReturnCallback;

public class RabbitMQReturnCallback implements ReturnCallback{
	private final Logger callbackLogger = LoggerFactory.getLogger("rabbitMQReturnCallback");

	@Override 
	public void returnedMessage(Message message, int replyCode, String replyText, String exchange, String routingKey) {
		if(callbackLogger.isErrorEnabled()){
			callbackLogger.error("message=" + message + ", replyCode=" + replyCode + ", replyText=" + replyText + ", exchange=" + exchange + ", routingKey=" + routingKey);
		}

	}

}
